package com.luhuiguo.cms.shared.event;

import com.google.gwt.event.shared.GwtEvent;
import com.luhuiguo.cms.shared.model.ArticleModel;

public class ArticleUpdatedEvent extends GwtEvent<ArticleUpdatedEventHandler> {

    public static Type<ArticleUpdatedEventHandler> TYPE = new Type<ArticleUpdatedEventHandler>();

    private final ArticleModel ArticleModel;

    public ArticleUpdatedEvent(ArticleModel ArticleModel) {
        this.ArticleModel = ArticleModel;
    }

    public ArticleModel getArticle() {
        return ArticleModel;
    }

    @Override
    public Type<ArticleUpdatedEventHandler> getAssociatedType() {
        return TYPE;
    }

    @Override
    protected void dispatch(ArticleUpdatedEventHandler handler) {
        handler.onArticleUpdated(this);
    }
}
